<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qscriptstring.cpp -->
<head>
  <title>QScriptString Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">QScriptString Class Reference<br /><span class="small-subtitle">[<a href="http://qt.nokia.com/doc/4.6/qtscript.html">QtScript</a> module]</span>
</h1>
<p>The QScriptString class acts as a handle to &quot;interned&quot; strings in a <a href="qscriptengine.html">QScriptEngine</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QScriptString&gt;</pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<p>This class was introduced in qtscriptclassic 4.4.</p>
<ul>
<li><a href="qscriptstring-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#QScriptString">QScriptString</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#QScriptString-2">QScriptString</a></b> ( const QScriptString &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#dtor.QScriptString">~QScriptString</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#toString">toString</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#operator-QString">operator QString</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#operator-not-eq">operator!=</a></b> ( const QScriptString &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QScriptString &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#operator-eq">operator=</a></b> ( const QScriptString &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qscriptstring.html#operator-eq-eq">operator==</a></b> ( const QScriptString &amp; <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QScriptString class acts as a handle to &quot;interned&quot; strings in a <a href="qscriptengine.html">QScriptEngine</a>.</p>
<p>QScriptString can be used to achieve faster (repeated) property getting/setting, and comparison of property names, of script objects.</p>
<p>To get a QScriptString representation of a string, pass the string to <a href="qscriptengine.html#toStringHandle">QScriptEngine::toStringHandle</a>(). The typical usage pattern is to register one or more pre-defined strings when setting up your script environment, then subsequently use the relevant QScriptString as argument to e.g&#x2e; <a href="qscriptvalue.html#property">QScriptValue::property</a>().</p>
<p>Call the <a href="qscriptstring.html#toString">toString</a>() function to obtain the string that a QScriptString represents.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QScriptString"></a>QScriptString::QScriptString ()</h3>
<p>Constructs an invalid <a href="qscriptstring.html">QScriptString</a>.</p>
<h3 class="fn"><a name="QScriptString-2"></a>QScriptString::QScriptString ( const QScriptString &amp; <i>other</i> )</h3>
<p>Constructs a new <a href="qscriptstring.html">QScriptString</a> that is a copy of <i>other</i>.</p>
<h3 class="fn"><a name="dtor.QScriptString"></a>QScriptString::~QScriptString ()</h3>
<p>Destroys this <a href="qscriptstring.html">QScriptString</a>.</p>
<h3 class="fn"><a name="isValid"></a>bool QScriptString::isValid () const</h3>
<p>Returns true if this <a href="qscriptstring.html">QScriptString</a> is valid; otherwise returns false.</p>
<h3 class="fn"><a name="toString"></a><a href="http://qt.nokia.com/doc/4.6/qstring.html">QString</a> QScriptString::toString () const</h3>
<p>Returns the string that this <a href="qscriptstring.html">QScriptString</a> represents, or a null string if this <a href="qscriptstring.html">QScriptString</a> is not valid.</p>
<p>See also <a href="qscriptstring.html#isValid">isValid</a>().</p>
<h3 class="fn"><a name="operator-QString"></a>QScriptString::operator QString () const</h3>
<p>Returns the string that this <a href="qscriptstring.html">QScriptString</a> represents, or a null string if this <a href="qscriptstring.html">QScriptString</a> is not valid.</p>
<p>See also <a href="qscriptstring.html#toString">toString</a>().</p>
<h3 class="fn"><a name="operator-not-eq"></a>bool QScriptString::operator!= ( const QScriptString &amp; <i>other</i> ) const</h3>
<p>Returns true if this <a href="qscriptstring.html">QScriptString</a> is not equal to <i>other</i>; otherwise returns false.</p>
<h3 class="fn"><a name="operator-eq"></a>QScriptString &amp; QScriptString::operator= ( const QScriptString &amp; <i>other</i> )</h3>
<p>Assigns the <i>other</i> value to this <a href="qscriptstring.html">QScriptString</a>.</p>
<h3 class="fn"><a name="operator-eq-eq"></a>bool QScriptString::operator== ( const QScriptString &amp; <i>other</i> ) const</h3>
<p>Returns true if this <a href="qscriptstring.html">QScriptString</a> is equal to <i>other</i>; otherwise returns false.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
